Zabbix doesn't update value from file neither with log[] nor with vfs.file.regexp[] item

Posted by tymik on Server Fault See other posts from Server Fault or by tymik
Published on 2014-05-19T16:13:00Z Indexed on 2014/05/27 9:30 UTC
Read the original article Hit count: 215

I am using Zabbix 2.2.
I have a very specific environment, where I have to generate desired data to file via script, then upload that file to ftp from host and download it to Zabbix server from ftp.
After file is downloaded, I check it with log[] and vfs.file.regexp[] items.

I use these items as below:

log[/path/to/file.txt,"C.*\s([0-9]+\.[0-9])$",Windows-1250,,"all",\1]
vfs.file.regexp[/path/to/file.txt,"C.*\s([0-9]+\.[0-9])$",Windows-1250,,,\1]

The line I am parsing looks like below:

                C:      8195Mb  5879Mb  2316Mb  28.2

The value I want to extract is 28.2 at the end of file.

The problem I am currently trying to solve is that when I update the file (upload from host to ftp, then download from ftp to Zabbix server), the value does not update.

I was trying only log[] at start, but I suspect, that log[] treat the file as real log file and doesn't check the same lines (althought, following the documentation, it should with "all" value), so I added vfs.file.regexp[] item too.

The log[] has received a value in past, but it doesn't update.
The vfs.file.regexp[] hasn't received any value so far.
file.txt has got reuploaded and redownloaded several times and situation doesn't change.
It seems that log[] reads only new lines in the file, it doesn't check lines already caught if there are any changes.

The zabbix_agentd.log file doesn't report any problem with access to file, nor with regexp construction (it did report "unsupported" for log[] key, when I had something set up wrong).

I use debug logging level for agent - I haven't found any interesting info about that problem.

I have no idea what I might be doing wrong or what I do not know about how Zabbix is performing these checks. I see 2 solutions for that: adding more lines to the file instead of making new one or making new files and check them with logrt[], but those doesn't satisfy my desires.
Any help is greatly appreciated.
Of course I will provide additional information, if requested - for now I don't know what else might be useful.

© Server Fault or respective owner

Related posts about ftp

Related posts about log-files